define(function() {
	return function($compile, $scope) {
		require([ "AppPathDir/video/videoInfos/support",
				"AppPathDir/video/videoInfos/add",
				"AppPathDir/video/videoInfos/update",
				"AppPathDir/video/videoInfos/delete" ], function(Support,
				UploadSupport, UpdateSupport, DelSupport) {
			/* 查询 start */
			$scope.search = {};
			$scope.cache = {};
			$scope.searchSupport = {
				run : function() {
					$scope.grid.reload({
						queryParam : {
							model : JSON.stringify($scope.search)
						}
					})
				}
			};
			$scope.playSupport = {
				run: function(data){
					window.top.tabs.addTab({
						id : data.id,
						title : data.videoName,
						remote : {
							url : getServer() + "/static/core/page/home/subHome.jsp",
							iframe : true,
							param : {
								html : getServer()
										+ "/static/app/video/videoInfos/views/play.html",
								ctrl : getServer()
										+ "/static/app/video/videoInfos/play.js",
								path : data.videoPath,
								id: data.id,
								videoIntroduce: escape(data.videoIntroduce)
							}
						}
					});
				}
			};
			$scope.uploadSupport = UploadSupport($scope, $compile);
			$scope.updateSupport = UpdateSupport($scope, $compile);
			$scope.delSupport = DelSupport($scope, $compile);
//			$scope.playSupport = PlaySupport($scope, $compile);
			$scope.grid = Support.init($scope.cache, $scope.uploadSupport,
					$scope.updateSupport, $scope.delSupport,
					$scope.searchSupport, $scope.playSupport);
		})
	}
});